%%
r=10; iters=100000;
for i=1:iters
    r(i+1)=r(i)*0.95+1/i^2;
end
t=1:iters;
loglog(r)
hold on;
loglog(t,r(1)./t.^2);


%%
clear all;
r(1)=10;r(2)=8; iters=100000;
for i=2:iters
    r(i+1)=max([r(i)*1.95-0.95*r(i-1) - 0.05*(1.95*r(i)-0.95*r(i-1)) +1/i^2,0]);
end
t=1:iters;
loglog(r)
hold on;
loglog(t,r(1)./t.^2,'.-');

%%
clear all; clc; 
r(1)=10.5;  r(2)=10; iters=100000; 
for i=2:iters
    r(i+1) = max([(1.99)* r(i) - 0.99*r(i-1) +1/i^2/1]); 
end
t=1:iters;
loglog(r)
hold on;
loglog(t,r(1)./t,'.-'); 



%%
clear all;
r(1)=10;  r(2)=1; iters=100000;
for i=2:iters
    r(i+1)=max([(1-1/i)*r(i)*1.9 - 0.9*r(i-1)+1/i^2]);
end
t=1:iters;
loglog(abs(r),'.-')
hold on;
loglog(t,r(1)./t,'-');
